<%@ page language="java" contentType="text/html; charset=ISO-8859-1" import="web_hr.*,java.sql.*"
    pageEncoding="ISO-8859-1"%>
 <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> 
  <link rel="stylesheet" type="text/css" href="./Res/Bootstrap/css/bootstrap.min.css">   
<link rel="stylesheet" type="text/css" href="./Res/Css/show.css">  

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<%  
    /*
              通过userid来查找用户详细信息并存入对象数组
    */
	String id = request.getParameter("userid");
	Model emp = new Model("hr_employee");
	Object[] obj=emp.find("emp_id", id);
	ResultSet rs = emp.eQuery("select * from hr_employee");
%>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Detail</title>
<style>
.button {
	    display: inline-block;
	    position: relative;
	    margin: 10px;
	    padding: 0 20px;
	    text-align: center;
	    text-decoration: none;
	    font: bold 12px/25px Arial, sans-serif;
	 
	    text-shadow: 1px 1px 1px rgba(255,255,255, .22);
	 
	    -webkit-border-radius: 30px;
	    -moz-border-radius: 30px;
	    border-radius: 30px;
	 
	    -webkit-box-shadow: 1px 1px 1px rgba(0,0,0, .29), inset 1px 1px 1px rgba(255,255,255, .44);
	    -moz-box-shadow: 1px 1px 1px rgba(0,0,0, .29), inset 1px 1px 1px rgba(255,255,255, .44);
	    box-shadow: 1px 1px 1px rgba(0,0,0, .29), inset 1px 1px 1px rgba(255,255,255, .44);
	 
	    -webkit-transition: all 0.15s ease;
	    -moz-transition: all 0.15s ease;
	    -o-transition: all 0.15s ease;
	    -ms-transition: all 0.15s ease;
	    transition: all 0.15s ease;
	}
.blue {
	    /* color: #19667d; */
	 	/* color:#ff1080dd; */
	 	color:white;
	 	font-color:white; 	
	    background: #70c9e3; /* Old browsers */
	    background: -moz-linear-gradient(top,  #70c9e3 0%, #39a0be 100%); /* FF3.6+ */
	    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#70c9e3), color-stop(100%,#39a0be)); /* Chrome,Safari4+ */
	    background: -webkit-linear-gradient(top,  #70c9e3 0%,#39a0be 100%); /* Chrome10+,Safari5.1+ */
	    background: -o-linear-gradient(top,  #70c9e3 0%,#39a0be 100%); /* Opera 11.10+ */
	    background: -ms-linear-gradient(top,  #70c9e3 0%,#39a0be 100%); /* IE10+ */
	    background: linear-gradient(top,  #70c9e3 0%,#39a0be 100%); /* W3C */
	}
.right{
	float:right;
}	

#button{
	width:320px;
}
</style>
</head>
<body class="container">
<h2><%=obj[1]+"'s detail "%></h2>
<div style="width:400px">
	<table class="table">
	<% /*
	            遍历，当列名不为password时，输出信息   
	    */
		ResultSetMetaData rsmd = rs.getMetaData();
		for(int i = 0;i<emp.getCol().length;i++){
			if(!rsmd.getColumnName(i+1).equals("PASSWORD")){
				String str = "<tr><th width=\"100px\">"+rsmd.getColumnName(i+1)+":-</th>"+"<td width=\"100px\">&nbsp"+(obj[i]+"</td></tr>");
				out.println(str);
			}
		}
		emp.close();
	%>
	</table>
	<div id="button">
	<%="<a href='delete.jsp?userid="+id+"'><button class='button blue'>Delete</button></a>"%> 
	<%="<a href='update.jsp?userid="+id+"'><button class='button blue right'>Update</button></a>"%>
	</div>
</div>   
</body>
</html>